﻿<UserControl x:Class="FontSizeWidget.FontSize"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Width="150" Height="120" >
    <UserControl.Resources>
        <Style TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <ContentPresenter Content="{TemplateBinding Button.Content}" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Key="Click">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.RenderTransform).(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.8"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.RenderTransform).(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.8"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <ImageBrush x:Key="fontSizeImage" ImageSource="Resources\fontsize.png"></ImageBrush>
        <ImageBrush x:Key="littleAImage" ImageSource="Resources\littleA.png"></ImageBrush>
        <ImageBrush x:Key="bigAImageImage" ImageSource="Resources\bigA.png"></ImageBrush>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="{StaticResource fontSizeImage}" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="2.5*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Button RenderTransformOrigin="0.5,0.5"  Grid.Column="0" x:Name="BigAButton" MouseEnter="BigAButton_MouseEnter" MouseLeave="BigAButton_MouseLeave" Click="BigAButton_Click" Height="66" Cursor="Hand" >
            <Image Source="Resources\biga.png" />
            <Button.RenderTransform>
                <ScaleTransform ScaleX="1" ScaleY="1"  />
            </Button.RenderTransform>
            <Button.Triggers>
                <EventTrigger RoutedEvent="Button.Click" >
                    <BeginStoryboard Storyboard="{StaticResource ResourceKey=Click}" />
                </EventTrigger>
            </Button.Triggers>
        </Button>
        <Button RenderTransformOrigin="0.5,0.5" Grid.Column="2" x:Name="SmallAButton" MouseEnter="SmallAButton_MouseEnter" MouseLeave="SmallAButton_MouseLeave" Click="SmallAButton_Click"  Height="66" Cursor="Hand" >
            <Image Source="Resources\littlea.png" />
            <Button.RenderTransform>
                <ScaleTransform ScaleX="1" ScaleY="1"  />
            </Button.RenderTransform>
            <Button.Triggers>
                <EventTrigger RoutedEvent="Button.Click" >
                    <BeginStoryboard Storyboard="{StaticResource ResourceKey=Click}" />
                </EventTrigger>
            </Button.Triggers>
        </Button>
        <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="24px" Foreground="#FFA5CB3D" Background="Transparent" FontSize="25" FontWeight="Bold" x:Name="SizeMessage" TextAlignment="Center" />
        <TextBlock Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,15" Foreground="#FFCBCBCB" Background="Transparent" x:Name="Message" FontSize="18" TextAlignment="Center">
        </TextBlock>
    </Grid>
</UserControl>